package p270jp.pxv.android.legacy.model;

import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteStatement;
import android.support.p024v4.media.C0261e;
import p104de.greenrobot.dao.AbstractDao;
import p104de.greenrobot.dao.Property;
import p104de.greenrobot.dao.internal.DaoConfig;

/* renamed from: jp.pxv.android.legacy.model.EmojiDao */
/* loaded from: classes2.dex */
public class EmojiDao extends AbstractDao<Emoji, Long> {
    public static final String TABLENAME = "EMOJI";

    /* renamed from: jp.pxv.android.legacy.model.EmojiDao$Properties */
    /* loaded from: classes2.dex */
    public static class Properties {

        /* renamed from: Id */
        public static final Property f19073Id = new Property(0, Long.class, "id", true, "_id");
        public static final Property EmojiId = new Property(1, Integer.class, "emojiId", false, "EMOJI_ID");
        public static final Property Slug = new Property(2, String.class, "slug", false, "SLUG");
        public static final Property Image = new Property(3, byte[].class, "image", false, "IMAGE");
    }

    public EmojiDao(DaoConfig daoConfig) {
        super(daoConfig);
    }

    public static void createTable(SQLiteDatabase sQLiteDatabase, boolean z) {
        String str = z ? "IF NOT EXISTS " : "";
        sQLiteDatabase.execSQL("CREATE TABLE " + str + "\"EMOJI\" (\"_id\" INTEGER PRIMARY KEY ,\"EMOJI_ID\" INTEGER,\"SLUG\" TEXT,\"IMAGE\" BLOB);");
    }

    public static void dropTable(SQLiteDatabase sQLiteDatabase, boolean z) {
        StringBuilder c = C0261e.m12042c("DROP TABLE ");
        c.append(z ? "IF EXISTS " : "");
        c.append("\"EMOJI\"");
        sQLiteDatabase.execSQL(c.toString());
    }

    @Override // p104de.greenrobot.dao.AbstractDao
    public boolean isEntityUpdateable() {
        return true;
    }

    public EmojiDao(DaoConfig daoConfig, DaoSession daoSession) {
        super(daoConfig, daoSession);
    }

    public void bindValues(SQLiteStatement sQLiteStatement, Emoji emoji) {
        sQLiteStatement.clearBindings();
        Long id = emoji.getId();
        if (id != null) {
            sQLiteStatement.bindLong(1, id.longValue());
        }
        Integer emojiId = emoji.getEmojiId();
        if (emojiId != null) {
            sQLiteStatement.bindLong(2, (long) emojiId.intValue());
        }
        String slug = emoji.getSlug();
        if (slug != null) {
            sQLiteStatement.bindString(3, slug);
        }
        byte[] image = emoji.getImage();
        if (image != null) {
            sQLiteStatement.bindBlob(4, image);
        }
    }

    public Long getKey(Emoji emoji) {
        if (emoji != null) {
            return emoji.getId();
        }
        return null;
    }

    /* JADX WARN: Can't rename method to resolve collision */
    @Override // p104de.greenrobot.dao.AbstractDao
    public Long readKey(Cursor cursor, int i) {
        int i2 = i + 0;
        if (cursor.isNull(i2)) {
            return null;
        }
        return Long.valueOf(cursor.getLong(i2));
    }

    public Long updateKeyAfterInsert(Emoji emoji, long j) {
        emoji.setId(Long.valueOf(j));
        return Long.valueOf(j);
    }

    @Override // p104de.greenrobot.dao.AbstractDao
    public Emoji readEntity(Cursor cursor, int i) {
        int i2 = i + 0;
        byte[] bArr = null;
        Long valueOf = cursor.isNull(i2) ? null : Long.valueOf(cursor.getLong(i2));
        int i3 = i + 1;
        Integer valueOf2 = cursor.isNull(i3) ? null : Integer.valueOf(cursor.getInt(i3));
        int i4 = i + 2;
        String string = cursor.isNull(i4) ? null : cursor.getString(i4);
        int i5 = i + 3;
        if (!cursor.isNull(i5)) {
            bArr = cursor.getBlob(i5);
        }
        return new Emoji(valueOf, valueOf2, string, bArr);
    }

    public void readEntity(Cursor cursor, Emoji emoji, int i) {
        int i2 = i + 0;
        byte[] bArr = null;
        emoji.setId(cursor.isNull(i2) ? null : Long.valueOf(cursor.getLong(i2)));
        int i3 = i + 1;
        emoji.setEmojiId(cursor.isNull(i3) ? null : Integer.valueOf(cursor.getInt(i3)));
        int i4 = i + 2;
        emoji.setSlug(cursor.isNull(i4) ? null : cursor.getString(i4));
        int i5 = i + 3;
        if (!cursor.isNull(i5)) {
            bArr = cursor.getBlob(i5);
        }
        emoji.setImage(bArr);
    }
}
